{include file="header.tpl"}
<div id="frame">
<h1>Effectif saison courante</h1>
<div id="title"></div>

<div id="content">
<form action="index.php?module=player&action=addcurrentseason" method="POST">
<table class="list" cellpadding="0" cellspacing="1">
<thead>
<tr> 
	<th>Joueur</th>
    {section name=season loop=$data[1]}
    <th>{$data[1][season]}</th>
    {/section}
    
     
</tr>
</thead>

<tbody>
    {literal}
        <script language="JavaScript">
            function checkBox() {
                for (i=0; i < document.update.elements.length; i++) {
                    if (document.update.elements[i].type == "checkbox" && !document.update.elements[i].checked) {
                        document.update.elements[i].value="0";
                        document.update.elements[i].checked=true;
                    }	
                }
                return true;
            }
        </script>
    {/literal}
    
    
    {foreach key=id_player from=$data[2] item=player name=players}
    
       	<tr height="15px" class="{if $smarty.foreach.players.iteration % 2 == 0}even{else}uneven{/if}" onmouseover="this.className='fsorange'" onmouseout="this.className='{if $smarty.foreach.players.iteration % 2 == 0}even{else}uneven{/if}'">
            <td><a href="index.php?module=player&action=profile&id_player={$id_player}">{$player[0]}</a></td>
            
            {foreach from=$data[2][$id_player] item=season key=cle name=seasons}
            
            {if $cle != '0'}
            <td> 
                {if $smarty.foreach.seasons.iteration ==2}
                    {if $season == 0} 
                        <input name='submit[{$id_player}]' type="submit" value="Inscrire">
                    {else}
                        <input disabled type="checkbox" class="checkbox" checked="checked">
                    {/if}
                {/if} 
                {if $smarty.foreach.seasons.iteration >2}
                      <input disabled type="checkbox" class="checkbox" name="season[]" value="1" {if $season == 1} checked="checked"{/if}>
                {/if} 
            </td>
            {/if}
            {/foreach}
           </tr>
     {/foreach}
</tbody>

</table>
</form>
</div>
</div>

{include file="footer.tpl"}





